package com.beiing.tianshuai.tianshuai.mine.presenter;

import com.beiing.tianshuai.tianshuai.base.BasePresenter;
import com.beiing.tianshuai.tianshuai.entity.ActivitiesPublishBean;
import com.beiing.tianshuai.tianshuai.mine.model.ActivitiesPublishModel;
import com.beiing.tianshuai.tianshuai.mine.model.ActivitiesPublishModelImpl;
import com.beiing.tianshuai.tianshuai.mine.view.ActivitiesPublishViewImpl;

/**
 * Created by Jinni on 2017/7/31 0031.
 */

public class ActivitiesPublishPresenter extends BasePresenter implements ActivitiesPublishPresenterImpl, ActivitiesPublishModel.OnRequestListener{

    private ActivitiesPublishModelImpl mModel;
    private ActivitiesPublishViewImpl mView;

    public ActivitiesPublishPresenter(ActivitiesPublishViewImpl view) {
        mView = view;
        mModel = new ActivitiesPublishModel(this);
    }

    @Override
    public void getActivitiesResult(String uid, String type, int star, int num) {
        mView.showProgress();
        mModel.getActivitiesResult(uid, type, star, num);
    }

    @Override
    public void onSuccess(ActivitiesPublishBean bean) {
        mView.hideProgress();
        mView.onRequestSuccess(bean);
    }

    @Override
    public void onError(Throwable e) {
        mView.hideProgress();
        mView.onRequestFailed(e);
    }
}
